package com.zhuhanpeng.cloud.login.control;


import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/login")
public class LoginController {


    @RequestMapping("/login")
    public String loginPage(HttpServletRequest request) {

            request.getSession().setAttribute("language", LocaleContextHolder.getLocale().toString());
            return "login/loginPage";
        }
        @RequestMapping("/main")
        public String mainPage () {
            return "redirect:/";
        }
    }
